var status = -1;
var selectionLog = [];

function start(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            qm.sendNormalTalk_Bottom("#face0#嗯……好像是缺了点什么……\r\n果然还是得有一头超像鬼的耷拉着的长假发才行。", 37, 2074100, false, true)
        } else {
            if (status === a++) {
                qm.sendNormalTalk_Bottom("果真如此吧？\r\n假发的话……有20个#b#t4034651##k应该就可以做出来了。", 37, 2074127, true, true)
            } else {
                if (status === a++) {
                    qm.sendNormalTalk_Bottom("#face0##b#t4034651##k，那去抓#b#o5100103##k就可以了吧？\r\n好吧，赶紧去收集20个吧。", 37, 2074100, true, true)
                } else {
                    if (status === a++) {
                        qm.forceStartQuest(30433, "");
                        qm.OnStartNavigation(224000120, 0, "", 0);
                        qm.dispose()
                    }
                }
            }
        }
    }
}

function end(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            qm.sendNormalTalk_Bottom("好吧，这些应该可以做出假发吧……\r\n稍等一下。", 37, 2074127, false, true)
        } else {
            if (status === a++) {
                qm.curNodeEventEnd(true);
                qm.setInGameDirectionMode(true, false, true);
                qm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection();
                qm.gainExp(568239);
                qm.updateInfoQuest(30433, "gExpCheck=1");
                qm.forceCompleteQuest(30433);
                qm.inGameDirectionEvent_AskAnswerTime(400);
                qm.gainItem(4034651, -20);
                qm.effect_Voice("Field.img/masteryBook/EnchantSuccess", 100)
            } else {
                if (status === a++) {
                    qm.setInGameDirectionMode(false, true, false);
                    qm.dispose()
                }
            }
        }
    }
};